package com.cy.model;

import com.cy.BasicModel;
import com.cy.ext.plugin.tablebind.TableBind;

import java.util.Date;
import java.util.List;

@SuppressWarnings("serial")
@TableBind(tableName="product_package_map",pkName = "p_id")
public class ProductPackageMap extends BasicModel<ProductPackageMap>{
	public static final ProductPackageMap dao = new ProductPackageMap();
    public static final String SELECT_ALL = "`p_id`,`product_id`,`pack_tag`,`product_count`,`create_time`";
    
    public List<ProductPackageMap> findByPackTag(String packTag){
    	return find("SELECT product_id, product_count FROM product_package_map WHERE pack_tag = ?", packTag);
    }

    public ProductPackageMap setPId(Integer pId){
        this.set("p_id",pId);
        return this;
    }

    public Integer getPId(){
        return this. get("p_id");
    }

    public ProductPackageMap setProductId (Integer productId){
        this.set("product_id",productId);
        return this;
    }

    public Integer getProductId (){
        return this. get("product_id");
    }

    public ProductPackageMap setPackTag(String packTag){
        this.set("pack_tag",packTag);
        return this;
    }

    public String getPackTag(){
        return this. get("pack_tag");
    }
    
    public ProductPackageMap setProductCount(Integer productCount){
    	this.set("product_count", productCount);
    	return this;
    }
    
    public Integer getProductCount(){
    	return this.get("product_count");
    }
    
    public ProductPackageMap setCreateTime(Date createTime){
    	this.set("create_time", createTime);
    	return this;
    }
    
    public Date getCreateTime(){
    	return this.get("create_time");
    }
}
